/*
 * @Descripttion: 模拟炒股H5
 * @version: 1.0.0
 * @Author: konglingzhan
 * @Date: 2019-06-24 15:48:31
 * @LastEditors: konglingzhan
 * @LastEditTime: 2019-11-27 16:09:49
 */

import axios from '@/service/request.js'

/* 把对象转化为formData表单格式 */
const formUtil = (obj) => {
  const formData = new FormData()
  if (Object.keys(obj).length === 0) { return formData }
  for (const key in obj) {
    formData.append(key, obj[key])
  }
  return formData
}

// 互联账号登陆初步生成模拟账户信息(given)
export const simulateLoginByWebAccount = params => axios.post('/simulate/noauth/simulateLoginByWebAccount', formUtil(params));

// 互联网账号登出
export const signOut = params => axios.post('/simulate/noauth/signOut', formUtil(params));

// 互联账号登陆初步生成模拟账户信息
export const zztLoginByWebAccount = params => axios.post('/simulate/noauth/zztLoginByWebAccount', formUtil(params));

// 资金账号登陆初步生成模拟账户信息
export const zztLoginByAccessToken = params => axios.post('/simulate/noauth/zztLoginByAccessToken', formUtil(params));

// 获取手机验证码
export const sendSMSCode = params => axios.post('/simulate/noauth/sendSMSCode', formUtil(params));

// 我的邀请
export const F700136 = params => axios.post('/simulate/noauth/F700136', formUtil(params));

// 比赛报名，生成完整模拟账户信息
export const F700102 = params => axios.post('/simulate/auth/F700102', formUtil(params));

// 获取本人账户信息
export const F700104 = params => axios.post('/simulate/auth/F700104', formUtil(params));

// 获取首页活动信息
export const F700105 = params => axios.post('/simulate/noauth/F700105', formUtil(params));

// 获取活动详情
export const F700106 = params => axios.post('/simulate/noauth/F700106', formUtil(params));

// 根据通过资金账号获取对应的活动列表
export const F700107 = params => axios.post('/simulate/noauth/F700107', formUtil(params));

// 获取首页练习场活动信息
export const F700108 = params => axios.post('/simulate/noauth/F700108', formUtil(params));

// 根据活动编号获取对应的组合详情信息
export const F700109 = params => axios.post('/simulate/noauth/F700109', formUtil(params));

// 获取首页广告图片
export const F700110 = params => axios.post('/simulate/noauth/F700110', formUtil(params));

// 获取活动榜单名称
export const F700111 = params => axios.post('/simulate/noauth/F700111', formUtil(params));

// 组合详情页个人信息
export const F700112 = params => axios.post('/simulate/noauth/F700112', formUtil(params));

// 获取他人个人主页账户信息
export const F700113 = params => axios.post('/simulate/noauth/F700113', formUtil(params));

// 修改手机号码
export const F700114 = params => axios.post('/simulate/noauth/F700114', formUtil(params));

// 获取token令牌
export const getToken = params => axios.post('/simulate/noauth/getToken', formUtil(params));

// 用户订阅
export const F700115 = params => axios.post('/simulate/auth/F700115', formUtil(params));

// 他人和本人组合信息
export const F700116 = params => axios.post('/simulate/noauth/F700116', formUtil(params));

// 订阅明细
export const F700117 = params => axios.post('/simulate/noauth/F700117', formUtil(params));

// 获取活动特殊字段信息
export const F700118 = params => axios.post('/simulate/noauth/F700118', formUtil(params));

// 粉丝
export const F700119 = params => axios.post('/simulate/noauth/F700119', formUtil(params));

// 公开赛活动白名单
export const F700120 = params => axios.post('/simulate/auth/F700120', formUtil(params));

// 校验敏感词或者活动名称是否重复
export const F700121 = params => axios.post('/simulate/noauth/F700121', formUtil(params));

// 首页消息
export const F700122 = params => axios.post('/simulate/noauth/F700122', formUtil(params));

// 普通比赛榜单
export const F700123 = params => axios.post('/simulate/noauth/F700123', formUtil(params));

// 普通比赛本人信息
export const F700124 = params => axios.post('/simulate/auth/F700124', formUtil(params));

// 判断是否有综合榜单
export const F700125 = params => axios.post('/simulate/noauth/F700125', formUtil(params));

// 综合榜单
export const F700126 = params => axios.post('/simulate/noauth/F700126', formUtil(params));

// 综合榜单本人信息
export const F700127 = params => axios.post('/simulate/auth/F700127', formUtil(params));

// 特殊信息字段榜单
export const F700128 = params => axios.post('/simulate/noauth/F700128', formUtil(params));

// 特殊信息字段本人信息
export const F700129 = params => axios.post('/simulate/auth/F700129', formUtil(params));

// 进行中活动列表信息
export const F700130 = params => axios.post('/simulate/noauth/F700130', formUtil(params));

// 本人进行活动信息
export const F700131 = params => axios.post('/simulate/auth/F700131', formUtil(params));

// 奖励明细
export const F700132 = params => axios.post('/simulate/auth/F700132', formUtil(params));

// 查询用户持仓
export const queryHoldStk = params => axios.post('/simulate/noauth/queryHoldStk', formUtil(params));

// 查询用户历史调仓
export const queryHistoryStkChange = params => axios.post('/simulate/noauth/queryHistoryStkChange', formUtil(params));

// 查询用户最新调仓
export const queryStkChange = params => axios.post('/simulate/noauth/queryStkChange', formUtil(params));

// 收益走势
export const queryProfitDiagram = params => axios.post('/simulate/noauth/queryProfitDiagram', formUtil(params));

// 查询热门买卖
export const queryHotBusiness = params => axios.post('/simulate/noauth/queryHotBusiness', formUtil(params));

export const getMemberList = params => axios.post('/system/member/list', formUtil(params));// find

// 根据活动id获取当前活动状态
export const F700135 = params => axios.post('/simulate/noauth/F700135', formUtil(params));

// 根据account_id获取数据
export const queryAsset = params => axios.post('/simulate/noauth/queryAsset', formUtil(params));

export const test = (params = { channel_type: '2', act_type_subset: '15', act_type: '0' }) => axios({
  url: 'http://mntest.china-invs.cn:8211/simulate/noauth/F700108',
  method: 'post',
  data: formUtil(params)
});